/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.oalam.bookstore.domain;

import com.oalam.bookstore.domain.accounts.Account;
import com.oalam.bookstore.domain.books.Book;
import com.oalam.bookstore.domain.books.Author;

/**
 *
 * @author Administrateur
 */
public class BusinessObjectFactory {
    
    private BusinessObjectFactory(){
        
    }

    public Author createAuthor(String name) {
        return new Author(name);
    }
    
    private static class SingletonHolder {
        private final static BusinessObjectFactory instance = new BusinessObjectFactory();
    }

    public static BusinessObjectFactory getInstance() {
        return SingletonHolder.instance;
    }
    
    public Book createBook(String title){
        return new Book(title);
    }
    
    public Account createAccount(String email){
        return new Account(email);
    }
}
